<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: id
  Date: 2021/1/16
  Time: 10:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page  isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../util/makerAndenterGoodAndselect1.jsp"%>
<html>
<head>
    <title>UPD EnterGoods2</title>
    <style type="text/css">
        #add{
            width: 1288px;
            height:1000px;
            position: absolute;
            top: 60px;
            left: 83px;
        }

        .fr{
            width: 400px;
            height: 300px;
            position: relative;
            left: 480px;
            top: 50px;
        }
        span{
            color: cadetblue;
        }
        input{
            text-align: center;
        }
        #aaa1:hover{
            background-color: rgb(250,250,250);
        }


    </style>
    <script type="text/javascript" src="../../../static/jquery-3.4.1.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#add").hover(function () {
                    $("#d3").hide()
                    $("#xs").hide()
                    $("#d2").hide()
                    $("#d4").hide()
                }
            )


            /*效验*/
            var fl=true;
            var num=$("#num").val();
            var money=$("#money").val();

            if(num==""||num==null ||money==""||money==null || num==0 ||money==0){
                $("#s1").html("?")
                $("#s2").html("?")
                fl=false;
            }else {
                fl=true;
            }

            $("#num").blur(function () {
                if($("#num").val()==null ||$("#num").val()=="" ||$("#num").val()==0){
                    $("#s1").html("个数不能为空")
                    fl=false;
                }else {
                    $("#s1").html("√")
                    fl=true;
                }
            })


            $("#money").blur(function () {
                if($("#money").val()==null ||$("#money").val()==""||$("#money").val()==0){
                    $("#s2").html("价格不能为空")
                    fl=false;
                }else {
                    $("#s2").html("√")
                    fl=true;
                }

            })


            /*表单验证*/
            $("Form").submit(function () {
                return fl;
            })



        })

    </script>
</head>
<body>
<div id="add">
    <div class="fr">
        <form action="${pageContext.request.contextPath}/enterGoods/upd">
        <span>商品编号</span>&nbsp;
        <input type="text" name="document2" style="width: 170px;height: 30px;border-radius: 6px" value="${goods.document2}" disabled>
        <br><br>
        <span>商品类型:</span>
        <select  style="width: 170px;height: 30px;border-radius: 6px" disabled>
            <c:if test="${goods.goodstyle==1}">
                <option >电子</option>
            </c:if>
            <c:if test="${goods.goodstyle==2}">
                <option >食品</option>
            </c:if>
            <c:if test="${goods.goodstyle==3}">
                <option >生活</option>
            </c:if>
        </select>

        <br><br>

        <span>商品名称</span>&nbsp;
        <input type="text" name="goodname2" style="width: 170px;height: 30px;border-radius: 6px" value="${goods.goodname2}" disabled>
        <br><br>

        <span>商品个数</span>&nbsp;
        <input type="text" name="num" style="width: 170px;height: 30px;border-radius: 6px" value="${goods.num}" id="num">
            <span id="s1" style="color: red"></span>
        <br><br>
        <input type="hidden" name="eid" value="${goods.eid}">
        <span>单价</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="text" name="money" style="width: 170px;height: 30px;border-radius: 6px" value="${goods.money}" id="money">
            <span id="s2" style="color: red"></span>
        <br><br>

        <span>单位</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="text" name="danwei" style="width: 170px;height: 30px;border-radius: 6px" value="${goods.danwei}" disabled>
        <br><br>

        <span>入仓之库:</span>&nbsp;
        <c:if test="${goods.rid==1}">
            <input type="text"  style="width: 170px;height: 30px;border-radius: 6px" value="东仓" disabled>
        </c:if>
        <c:if test="${goods.rid==2}">
            <input type="text"  style="width: 170px;height: 30px;border-radius: 6px" value="西仓" disabled>
        </c:if>
        <c:if test="${goods.rid==3}">
            <input type="text"  style="width: 170px;height: 30px;border-radius: 6px" value="南仓" disabled>
        </c:if>
        <c:if test="${goods.rid==4}">
            <input type="text"  style="width: 170px;height: 30px;border-radius: 6px;text-indent: 1em" value="北仓" disabled >
        </c:if>
        <br><br>
        &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="submit" id="aaa1" value="修改" style="display: block;width: 130px;height: 30px;border-radius: 6px;text-align: center;padding-top: 6px;margin-left: 64px">
        </form>
    </div>
</div>
</body>
</html>
